#ifndef CPARTICLESPHERE_H
#define CPARTICLESPHERE_H

#include <C3dValue.h>
#include <string.h>

namespace NApiCfd
{
    class CParticleSphere
    {
    public:
        CParticleSphere() :
            m_surfaceID(-1), m_radius(0.0),
            m_contactRadius(0.0),
            m_usesContactRadius(false)
        {
            m_surfaceName[0] = '\0';
        }

        CParticleSphere(const CParticleSphere& element)
        {
            *this = element;
        }

        CParticleSphere& operator=(const CParticleSphere& rhs)
        {
            m_surfaceID = rhs.m_surfaceID;
            m_radius = rhs.m_radius;
            m_contactRadius = rhs.m_contactRadius;
            m_usesContactRadius = rhs.m_usesContactRadius;
            m_position = rhs.m_position;
            setSurfaceName(rhs.m_surfaceName);

            return *this;
        }

        ~CParticleSphere() { }

        inline double getRadius() const { return m_radius; }
        inline void setRadius(double radius) { m_radius = radius; }

        inline double getContactRadius() const { return m_contactRadius; }
        inline void setContactRadius(double radius) { m_contactRadius = radius; }

        inline bool usesContactRadius() const { return m_usesContactRadius; }
        inline void setUsesContactRadius(bool b) { m_usesContactRadius = b; }

        const char* getSurfaceName() const { return m_surfaceName; }
        void setSurfaceName(const char* type) 
        { 
            strncpy(m_surfaceName, type, MAX_TYPENAME_SZ - 1);
            m_surfaceName[MAX_TYPENAME_SZ - 1] = 0; 
        }

        const C3dValue& getPosition() const { return m_position; }
        void setPosition(const C3dValue& postion) { m_position = postion; }

        int getSurfaceID() const { return m_surfaceID; }
        void setSurfaceID(int id) { m_surfaceID = id; }

    protected:
        const static int MAX_TYPENAME_SZ = 64; /**< Maximum name for surface type */

        int m_surfaceID;
        double m_radius;
        double m_contactRadius;
        bool m_usesContactRadius;
        C3dValue m_position;
        char m_surfaceName[MAX_TYPENAME_SZ];
    };
}

#endif
